#include <bits/stdc++.h>
using namespace std;
int m,n,a[10005],f[10005],d=1,minm=-20000,x,y,w;
int read();
void wt(int);
int main(){
	freopen("duel.in","r",stdin);
	freopen("duel.out","w",stdout);
	n=read();
	for(int i=1;i<=n;i++){
		a[i]=read();
		if(a[i]!=1||a[i]!=2)w=1;
		else if(a[i]==2)m++;
	}
	sort(a+1,a+n+1);
	if(w==1){
		m=0;
		while(d){
			minm=-20000;
			for(int i=1;i<n;i++){
				for(int j=1;j<=n;j++){if(f[j]==0&&f[i]!=1&&a[j]>a[i]){f[j]=2;f[i]=1;minm=a[j];break;}}
				if(minm==-20000){d=0;break;}
			}
		}
		for(int i=1;i<=n;i++){
			if(f[i]!=1)m++;
		}
	}
		wt(m);
	
	return 0;
}
int read(){
	int x=0,f=1; char c;
	while((c=getchar())>'9'||c<'0')if(c=='-')f=-1;
	x=(c^48);
	while((c=getchar())<='9'&&c>='0')x=(x<<3)+(x<<1)+(c^48);
	return x*f;
}
void wt(int q){
	if(q<0){putchar('-');q=-q;}
	if(q>9)wt(q/10);
	putchar('0'+q%10);
}
